package name.sraynal.coodiary.storage;

import java.util.Date;

public class Quote {
	
	public static final Date DEFAULT_DATE = new Date("10/30/08");
	private Date date;
	private String value;
	private String type;
	
	public Quote(Date date, String aValue, String type) {
		super();
		this.date = date;
		this.value = aValue.substring(0,1).toUpperCase()+ aValue.substring(1);
		this.value = this.value.trim();
		if ((this.value.charAt(value.length() - 1) != '.')
			&& (this.value.charAt(value.length() - 1) != '!')
			&& (this.value.charAt(value.length() - 1) != '?')) {
			this.value += '.';
		}
		this.type = type;
		if (type == null) {
			throw new RuntimeException("Quote [" + aValue + "] should be typed.");
		}
	}

	public Date getDate() {
		return date;
	}

	public String getValue() {
		return value;
	}

	public String getType() {
		return type;
	}
}
